home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
gamesrc
/
rtankasm
/
explain1.asm
< prev
next >
Wrap
Assembly Source File
|
1989-01-07
|
3KB
|
102 lines
; EXPLAIN1.ASM
; ------------
; Please explain why the data in this SEPDATA segment get's used as
; MALLOC() space when included in a TC program.
;
; Therefore, how can I get another 64k segment to use as a storage
; area for my graphics driver code.
; (Without going into HUGE or LARGE memory models!
;
ASSUME cs:_TEXT, DS:SEPDATA
SEPDATA SEGMENT WORD 'SDATA'
public overwrite, notile
;
; This data following gets overwritten when TURBO-C uses
; MALLOC()'ed data
;
; Why?? it's in a different segment, isn't this all I have to do?
;
overwrite db 123
notile db 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h
db 000h, 000h, 000h, 000h
corner db 055h, 055h, 040h, 000h
db 040h, 000h, 040h, 000h
db 040h, 000h, 040h, 000h
db 040h, 000h, 040h, 000h
allwhite db 0FFh, 0FFh, 0FFh, 0FFh
db 0FFh, 0FFh, 0FFh, 0FFh
db 0FFh, 0FFh, 0FFh, 0FFh
db 0FFh, 0FFh, 0FFh, 0FFh
imagelist dw notile ; pointers to images
dw corner
dw allwhite
dw 0
map db 9000 dup(?) ; Map array, lists which tile
; appears where.
; Each entry is an index into
; the imagelist file
scrbuf db 16200 dup(?) ; Screen swap buffer
SEPDATA ENDS
_TEXT SEGMENT BYTE PUBLIC 'CODE'
PUBLIC _refreshscr
;
; This is a sample procedure called from TURBO-C which should make use
; of the new data segment
;
;
; Ignore what this procedure actually does ... it's just for example.
;
_refreshscr proc
push bp
mov bp,sp
push ds
push es
push si
push di
push cx
cli
mov ax,SEPDATA
mov ds,ax
mov ax,0B800h
mov es,ax
mov si,OFFSET scrbuf
mov cx,16192
mov di,0
rep movsb
sti
pop cx
pop di
pop si
pop es
pop ds
pop bp
ret
_refreshscr endp
_TEXT ENDS
END